E - This parameter is a generic for the type of elements that will be stored in the list.
Please note that all elements must implement the KeyedElement interface.
If the elements, themselves, do not implement the KeyedElement interface,
a super-class of element must implement the KeyedElement interface.K - This parameter is a generic for the type of key each element must have.public interface ListInterface<E extends KeyedElementInterface<K>,K>
| Modifier and Type | Method and Description |
|---|---|
E |
add(E element)
This method is called to add the specified Element to the end of the list.
|
E |
get(K key)
This method is called to retrieve the Element at the specified index.
|
boolean |
isEmpty()
This method is called to determine if the list is empty.
|
E |
remove(K key)
This method is called to remove the Element at the specified index
|
void |
removeAll()
This method removes all Elements from the list, making the list empty.
|
E |
replace(E element)
This method will use the key of the specified element to find an already existing member of the
LinkedList and will replace the existing element with the specified one.
|
int |
size()
This method is called to obtain the count of elements in the list.
|
int size()
boolean isEmpty()
E add(E element)
element - A reference to the element to be added to the end of the list.
All Elements being added to the list must implement the
KeyedElement interface.KeyedElementInterfaceE get(K key)
key - The key of the element being retrievedE replace(E element)
element - A reference to the new element that will replace the current element
in the list.E remove(K key)
key - Indicates the key of the element to remove.void removeAll()